const Router = require("koa-router");
const router = new Router({ prefix: "/demo" });

const Mock = require("mockjs");
const random = Mock.Random;

router.get("/", (ctx, next) => {
  const obj = {
    id: random.integer(),
    name: random.cname(),
  };

  ctx.response.body = obj;
});

router.post("/", (ctx, next) => {
  ctx.response.body = "Put~";
});

module.exports = router;
